<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container{
            width: 300px;
            height: 300px;
            background-color: lightgreen;
            position: relative;
        }

        .centered{
            position: absolute;
            left: 50%;
            top: 50%;
            background-color: lightblue;
            width: 100px;
            height: 100px;
           transform: translate(-50%,-50%);
        }
    </style>
</head>
<body>
    <div class="container">
        <div class='centered'></div>
    </div>
</body>
</html>